home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 2.4 KB | 54 lines | [TEXT/ttxt] |
- --<<<-
- -- Build group of title containers, each holding one graphable ModelCar.
- -- (These should really be accessory containers instead, but we want to
- -- be able to load them into the KMP externally, and in ScriptX V1.0,
- -- that can only be achieved with title containers.)
-
- global scriptDir := theScriptDir
- global titleDir := parentDir theScriptDir
- global theMediaDir := spawn scriptDir "modCars"
-
- -- Make the StorageContainer for the car database.
- global theLib := new LibraryContainer \
- dir:titleDir \
- path: "models.sxl" \
- mode:@create \
- targetCollection:(new HashTable)
-
- global database := new Array
- append database #("achieva", #(16321, 14120, 14.4, 20, "4-Door Sedan", 24, 150, 9000, 26, 1994, "Achieva", 161, 12.4))
- append database #("acura", #(22319, 21090, 11.4, 23, "Coupe", 28, 150, 11000, 30, 1994, "Acura Legend", 110, 8.4))
- append database #("civic", #(17213, 16213, 10.4, 25, "2-Door Sedan", 30, 120, 9000, 32, 1994, "Honda Civic", 131, 11.4))
- append database #("corolla", #(16121, 15049, 9.0, 22, "Coupe", 28, 140, 10000, 30, 1994, "Toyota Corolla", 140, 12.4))
- append database #("jeep", #(21399, 18231, 19.9, 17, "Sport-Utility", 21, 230, 14000, 23, 1994, "Jeep Cherokee", 152, 12.4))
- append database #("miata", #(16281, 15823, 5.9, 22, "Sports Car", 27, 220, 11000, 29, 1994, "Mazda Miata", 123, 9.0))
- append database #("trooper", #(24872, 22357, 19.4, 15, "Sport-Utility", 20, 190, 14000, 22, 1994, "Isuzu Trooper", 161, 11.7))
- append database #("rx7", #(18120, 17132, 5.1, 21, "Sports Car", 27, 270, 12000, 29, 1994, "Maxda RX7", 103, 7.5))
- append database #("probe", #(16400, 15873, 8.2, 23, "Sports Car", 29, 120, 11000, 30, 1994, "Ford Probe", 120, 8.9))
- append database #("bmw", #(29310, 26912, 14.4, 21, "2-Door Sedan", 26, 340, 20000, 28, 1994, "BMW 325i", 117, 9.0))
-
- -- Create title containers for each car.
- for obj in database do
- (
- local objName := obj[1]
- local objProperties := obj[2]
-
- -- Get the graphic for the object.
- local media := new KeyedLinkedList
- local fileName := objName + ".bmp"
- local theStream := getStream theMediaDir fileName @readable
- local thumbnail := importMedia theImportExportEngine theStream \
- @image @dib @bitmap
- thumbnail.invisiblecolor := whitecolor
- append objProperties thumbnail
-
- -- Create the object.
- -- local obj := apply makeModelCar ModelCar objProperties
-
- )
- add theLib @data database
- close theLib
-
- "Compiled mkModcars.sx"
- -->>>
-